<?php

namespace App\Http\Middleware;

use App\Repositories\SettingRepository;
use App\Services\SettingService;
use Closure;

class Setting
{

    private $setting;

    public function __construct(SettingService $service)
    {
        $this->setting = $service;
    }

    public function handle($request, Closure $next)
    {
        $settings = $this->setting->getSettingsFromCache();
        config(['setting' => $settings]);
        return $next($request);
    }
}
